{% extends "base.html" %}
{% load i18n %}

{% block htmlhead %}
{{block.super}}
<style type="text/css" media="screen">
#filelist {
	background-color: white;
        padding: 10px;
        /*width: 800px;*/
        /*line-height: 200%;*/
        margin-right: 100px;
        border: 5px solid #ccc;
}
</style>



<script type="text/javascript">
function submitform()
{
  document.myform.submit();
}
</script>


<link rel="stylesheet" type="text/css" media="screen" href="/site_media/css/jquery-ui-1.7.2.custom.css" />
<link rel="stylesheet" type="text/css" media="screen" href="/site_media/css/ui.jqgrid.css" />
 
<script src="/site_media/js/jquery.js" type="text/javascript"></script>
<script src="/site_media/js/i18n/grid.locale-en.js" type="text/javascript"></script>
<script src="/site_media/js/jquery.jqGrid.min.js" type="text/javascript"></script>



<script type="text/javascript">
jQuery(document).ready(function(){ 

jQuery("#anon1").jqGrid({
			datatype: "local", 
			height: 250, 
			colNames:['ID','Title', 'Name', 'Age', 'Gender'], 
			colModel:[ 
					{name:'id',index:'id', width:60, sorttype:"int"}, 
					{name:'title',index:'title', width:100}, 
					{name:'name',index:'name', width:110}, 
					{name:'age',index:'age', width:80, align:"right"}, 
					{name:'gender',index:'gender', width:80, align:"right"}, 
				], 
			multiselect: true, 
			caption: "Information to be anonymized"
			});

var mydata = [{% for key,object in objects.items %}
	{ id:"{{forloop.counter}}", title:"<a href=\"/hide/anondoc/{{object.deidid}}\">{{object.value.title}}</a>", age:"{{object.value.age}}", gender:"{{object.value.gender}}", name:"{{object.value.name}}" },
{% endfor %}];

for(var i=0;i<=mydata.length;i++) {
	jQuery("#anon1").jqGrid('addRowData',i+1,mydata[i]);
}

});
					


</script>

{% endblock %}

{% block title %}
HIDE v1.5
{% endblock %}

{% block content %}
<h2>You are about to anonymize the following documents</h2>
<form name="myform" method="post" action="#">
{% csrf_token %}
<a href="javascript: submitform()">Statistical De-identification</a> 
</form>
<div id="filelist">

<table id="anon1"></table>
  
  
</div>
{% endblock %}

